package com.msb.internalcommon.util;

/**
 * @Auther: WuWen
 * @Date: 2023/8/16 - 08 - 16 - 20:25
 * @Description: com.msb.internalcommon.util
 * @version: 1.0
 */
public class RedisPrefixUtils {

    //乘客验证码前缀
    public static String verificationCodePrefix = "passenger-verification-code-";

    // token前缀
    public static String tokenPrefix = "token-";
    /**
     * 通过手机号生成redis中的key
     * @param passengerPhone 手机号
     * @return
     */
    public static String generatorKeyByPhone(String passengerPhone){

        return verificationCodePrefix + passengerPhone;
    }

    /**
     * 通过手机号和身份生成redis中token的key
     * @param phone
     * @param identity
     * @return
     */
    public static String generatorTokenKey(String phone, String identity, String tokenType){
        String tokenKey = tokenPrefix+phone+"-"+identity+"-"+tokenType;
        return tokenKey;
    }
}
